<template>
  <div class="app-container">
    <el-card>
      <el-form style="width: 1000px;">
        <form-details ref="formDetails"/>
        <el-form-item>
          <el-button type="primary" @click="handleCreateTmp" style="margin-left: 200px;">
            暂存
          </el-button>
          <el-button type="primary" @click="handleCreate" :disabled="disabledBtn" style="margin-left: 200px;">
            提交
          </el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
  import FormDetails from './form-details.vue'

  export default {
    name: 'MhProjectInfo-FormAdd',
    components: { FormDetails },
    mounted() {
      this.init()
    },
    data() {
      return {
        disabledBtn:false
      }
    },
    methods: {
      init() {
        this.$refs['formDetails'].defaultTemp()
      },
      handleCreate() {
        this.disabledBtn = true
        setTimeout(() => {
          this.disabledBtn = false
        }, 2000)
        this.$refs['formDetails'].createData()
      },
      handleCreateTmp() {
        this.$refs['formDetails'].createTmpData()
      }
    }
  }
</script>
<style>

</style>
